﻿using Services4KouDai.Models;
using Services4KouDai.Parsers;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Services4KouDai.Services
{
    public class GoodsDetailService : IGoodsDetailService
    {
        public async Task<ServiceRespInfo> GetGoodsDetail(string id, Platform platform = Platform.WP8, string tokenId = "", string am = "", string reqId = "")
        {
            string url = ServiceConstants.WP8GoodsDetail;

            if (platform == Platform.WIN8)
            {
                url = ServiceConstants.WIN8GoodsDetail;
            }
            Dictionary<string, object> body = new Dictionary<string, object>();
            body.Add("id", id);
            body.Add("tokenid", tokenId);
            body.Add("am", am);
            body.Add("reqID", reqId);

            return await CommonService.ServiceReq(url, body, new GoodsDetail(), new GoodsDetailParser(platform));
        }
    }
}
